package cn.com.huzo.model.entities.inventory;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 入库单主表实体类
 * 
 * @author 吴旭
 */
public class StockInHeaderEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = -1153206327681112715L;
    private Long HeaderId;                   // 标识，自动增加
    private String BillNo;                   // 单据号（自动生成）
    private String WayBillNo;                // 货单号
    private Timestamp ArrivalDate;           // 到货日期
    private Timestamp StockInDate;           // 入库日期
    private Long InspectedBy;                // 验料员
    private String InspectedByName;
    private Timestamp InspectedDate;         // 验料日期
    private Long SupplierId;                 // 供应商ID
    private String SupplierName;
    private Integer ReasonId;                // 库存操作原因码
    private Boolean BalanceFlag;             // 结存标记
    private String Description;              // 备注
    private String StyleNo;                  // 款号（由明细中款号组成301/302)

    public Long getHeaderId() {
        return HeaderId;
    }

    public String getBillNo() {
        return BillNo;
    }

    public String getWayBillNo() {
        return WayBillNo;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getArrivalDate() {
        return ArrivalDate;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getStockInDate() {
        return StockInDate;
    }

    public Long getInspectedBy() {
        return InspectedBy;
    }

    public String getInspectedByName() {
        return InspectedByName;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getInspectedDate() {
        return InspectedDate;
    }

    public void setInspectedDate(Timestamp InspectedDate) {
        this.InspectedDate = InspectedDate;
    }

    public Long getSupplierId() {
        return SupplierId;
    }

    public String getSupplierName() {
        return SupplierName;
    }

    public Integer getReasonId() {
        return ReasonId;
    }

    public Boolean getBalanceFlag() {
        return BalanceFlag;
    }

    public String getDescription() {
        return Description;
    }

    public String getStyleNo() {
        return StyleNo;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public void setBillNo(String BillNo) {
        this.BillNo = BillNo;
    }

    public void setWayBillNo(String WayBillNo) {
        this.WayBillNo = WayBillNo;
    }

    public void setArrivalDate(Timestamp ArrivalDate) {
        this.ArrivalDate = ArrivalDate;
    }

    public void setStockInDate(Timestamp StockInDate) {
        this.StockInDate = StockInDate;
    }

    public void setInspectedBy(Long InspectedBy) {
        this.InspectedBy = InspectedBy;
    }

    public void setInspectedByName(String InspectedByName) {
        this.InspectedByName = InspectedByName;
    }

    public void setSupplierId(Long SupplierId) {
        this.SupplierId = SupplierId;
    }

    public void setSupplierName(String SupplierName) {
        this.SupplierName = SupplierName;
    }

    public void setReasonId(Integer ReasonId) {
        this.ReasonId = ReasonId;
    }

    public void setBalanceFlag(Boolean BalanceFlag) {
        this.BalanceFlag = BalanceFlag;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    public void setStyleNo(String StyleNo) {
        this.StyleNo = StyleNo;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof StockInHeaderEntity)) {
            return false;
        }

        final StockInHeaderEntity that = (StockInHeaderEntity) o;

        return new EqualsBuilder()
                .append(this.getHeaderId(), that.getHeaderId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getHeaderId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
